package com.szjz.elasticsearch.eshelper.wrapper;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author 史博
 * @desc
 * @date 2021/1/18 下午5:16 周一
 */
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Condition {

	/**
	 * or
	 */
	public static final String OR = "or";
	/**
	 * or LIKE '%值'
	 */
	public static final String OR_LIKE_LEFT = "orLikeLeft";
	/**
	 * or LIKE '值%'
	 */
	public static final String OR_LIKE_RIGHT = "orLikeRight";
	/**
	 * or LIKE '%值%'
	 */
	public static final String OR_LIKE = "orLike";

	/**
	 * =
	 */
	public static final String EQ = "eq";
	/**
	 * !=
	 */
	public static final String NEQ = "neq";
	/**
	 * >
	 */
	public static final String GT = "gt";
	/**
	 * <
	 */
	public static final String LT = "lt";
	/**
	 * >=
	 */
	public static final String GTE = "gte";
	/**
	 * <=
	 */
	public static final String LTE = "lte";
	/**
	 * 范围
	 */
	public static final String IN = "in";

	/**
	 * is null
	 */
	public static final String IS_NULL = "isNull";

	/**
	 * is not null
	 */
	public static final String IS_NOT_NULL = "isNotNull";

	/**
	 * 通配符 LIKE '*值'
	 */
	public static final String LIKE_LEFT = "likeLeft";

	/**
	 * 通配符 LIKE '值*'
	 */
	public static final String LIKE_RIGHT = "likeRight";

	/**
	 * 通配符 LIKE '*值*'
	 */
	public static final String LIKE = "like";

	/**
	 * 通配符 LIKE '?值'
	 * 只能匹配左边一个字符
	 */
	public static final String LIKE_LEFT_ONE = "likeLeftOne";

	/**
	 * 通配符 LIKE '值?'
	 * 只能匹配右边一个字符
	 */
	public static final String LIKE_RIGHT_ONE = "likeRightOne";

	/**
	 * 升序
	 */
	public static final String ORDER_BY_ASC = "orderByAsc";

	/**
	 * 降序
	 */
	public static final String ORDER_BY_DESC = "orderByDesc";

	/**
	 * 获取指定字段资源
	 */
	public static final String INCLUDE_FIELDS = "includeFields";

	/**
	 * 获取指定字段以外的字段资源
	 */
	public static final String EXCLUDE_FIELDS = "excludeFields";

	/**
	 * condition
	 */
	private String condition;

	/**
	 * column
	 */
	private String column;

	/**
	 * includeColumns
	 */
	private List<String> includeColumns;

	/**
	 * excludeColumns
	 */
	private List<String> excludeColumns;

	/**
	 * value
	 */
	private Object value;

	/**
	 * values
	 */
	private List<?> values;

}
